package xyz.scootaloo.draft.demo;

/**
 * @author flutterdash@qq.com
 * @since 2021/5/9 8:14
 */
public class CatchDemo {

    public static void main(String[] args) {
        try {
            fun(2);
        } catch (UserException us) {
            System.out.println("user ex");
        } catch (RuntimeException re) {
            System.out.println("rt ex");
        }
    }

    private static void fun(int sign) {
        if (sign == 1)
            throw new UserException();
        else
            throw new RuntimeException();
    }

    static class UserException extends RuntimeException {

    }

}
